
package wang.day10;

public class Girl {
    public static void main(String[] args) {
        girlfriend[] arr = new girlfriend[4];
        girlfriend gf1 = new girlfriend("qu", 19, "Ů", "zuoai");
        girlfriend gf2 = new girlfriend("ni", 23, "Ů", "daqiu");
        girlfriend gf3 = new girlfriend("ma", 46, "Ů", "paobu");
        girlfriend gf4 = new girlfriend("de", 26, "Ů", "yuepao");
        arr[0] = gf1;
        arr[1] = gf2;
        arr[2] = gf3;
        arr[3] = gf4;
        int sum = 0, avg;
        for (int i = 0; i < arr.length; i++) {
            girlfriend gf = arr[i];
            sum = sum + gf.getAge();
        }
        avg = sum / arr.length;
        System.out.println(avg);
        int count=0;
        for (int i = 0; i < arr.length; i++) {
            girlfriend gf=arr[i];
            if(gf.getAge()<avg){
                count++;
                System.out.println(gf.getSex()+","+gf.getAge()+","+gf.getHobby()+","+gf.getName());
            }
        }
        System.out.println(count);
    }
}


